load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
    name = "go_default_library",
    srcs = [
        "completion.go",
        "create.go",
        "create_cluster.go",
        "create_ig.go",
        "create_secret.go",
        "create_secret_dockerconfig.go",
        "create_secret_encryptionconfig.go",
        "create_secret_keypair.go",
        "create_secret_keypair_ca.go",
        "create_secret_sshpublickey.go",
        "create_secret_tls.go",
        "create_secret_weave_encryptionconfig.go",
        "delete.go",
        "delete_cluster.go",
        "delete_instancegroup.go",
        "delete_secret.go",
        "describe.go",
        "describe_secrets.go",
        "edit.go",
        "edit_cluster.go",
        "edit_instancegroup.go",
        "editor.go",
        "export.go",
        "export_kubecfg.go",
        "gen_help_docs.go",
        "get.go",
        "get_cluster.go",
        "get_instancegroups.go",
        "get_secrets.go",
        "import.go",
        "import_cluster.go",
        "main.go",
        "pkix.go",
        "replace.go",
        "rollingupdate.go",
        "rollingupdatecluster.go",
        "root.go",
        "set.go",
        "set_cluster.go",
        "toolbox.go",
        "toolbox_bundle.go",
        "toolbox_convert_imported.go",
        "toolbox_dump.go",
        "toolbox_template.go",
        "update.go",
        "update_cluster.go",
        "upgrade.go",
        "upgrade_cluster.go",
        "validate.go",
        "validate_cluster.go",
        "version.go",
    ],
    importpath = "k8s.io/kops/cmd/kops",
    visibility = ["//visibility:private"],
    deps = [
        "//:go_default_library",
        "//cmd/kops/util:go_default_library",
        "//pkg/apis/kops:go_default_library",
        "//pkg/apis/kops/model:go_default_library",
        "//pkg/apis/kops/registry:go_default_library",
        "//pkg/apis/kops/util:go_default_library",
        "//pkg/apis/kops/v1alpha1:go_default_library",
        "//pkg/apis/kops/validation:go_default_library",
        "//pkg/assets:go_default_library",
        "//pkg/bundle:go_default_library",
        "//pkg/client/simple:go_default_library",
        "//pkg/cloudinstances:go_default_library",
        "//pkg/commands:go_default_library",
        "//pkg/dns:go_default_library",
        "//pkg/edit:go_default_library",
        "//pkg/featureflag:go_default_library",
        "//pkg/formatter:go_default_library",
        "//pkg/instancegroups:go_default_library",
        "//pkg/k8sversion:go_default_library",
        "//pkg/kopscodecs:go_default_library",
        "//pkg/kubeconfig:go_default_library",
        "//pkg/model/components:go_default_library",
        "//pkg/pki:go_default_library",
        "//pkg/pretty:go_default_library",
        "//pkg/resources:go_default_library",
        "//pkg/resources/ops:go_default_library",
        "//pkg/sshcredentials:go_default_library",
        "//pkg/try:go_default_library",
        "//pkg/util/templater:go_default_library",
        "//pkg/validation:go_default_library",
        "//upup/pkg/fi:go_default_library",
        "//upup/pkg/fi/cloudup:go_default_library",
        "//upup/pkg/fi/cloudup/aliup:go_default_library",
        "//upup/pkg/fi/cloudup/awsup:go_default_library",
        "//upup/pkg/fi/cloudup/gce:go_default_library",
        "//upup/pkg/fi/utils:go_default_library",
        "//upup/pkg/kutil:go_default_library",
        "//util/pkg/tables:go_default_library",
        "//util/pkg/text:go_default_library",
        "//util/pkg/ui:go_default_library",
        "//util/pkg/vfs:go_default_library",
        "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
        "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library",
        "//vendor/github.com/blang/semver:go_default_library",
        "//vendor/github.com/ghodss/yaml:go_default_library",
        "//vendor/github.com/spf13/cobra:go_default_library",
        "//vendor/github.com/spf13/cobra/doc:go_default_library",
        "//vendor/github.com/spf13/viper:go_default_library",
        "//vendor/golang.org/x/crypto/ssh:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
        "//vendor/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library",
        "//vendor/k8s.io/cli-runtime/pkg/genericclioptions/resource:go_default_library",
        "//vendor/k8s.io/client-go/kubernetes:go_default_library",
        "//vendor/k8s.io/client-go/plugin/pkg/client/auth:go_default_library",
        "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library",
        "//vendor/k8s.io/client-go/util/homedir:go_default_library",
        "//vendor/k8s.io/helm/pkg/strvals:go_default_library",
        "//vendor/k8s.io/klog:go_default_library",
        "//vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util:go_default_library",
        "//vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/editor:go_default_library",
        "//vendor/k8s.io/kubernetes/pkg/kubectl/util/i18n:go_default_library",
        "//vendor/k8s.io/kubernetes/pkg/kubectl/util/templates:go_default_library",
    ],
)

go_binary(
    name = "kops",
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
    x_defs = {
        "k8s.io/kops.Version": "{STABLE_KOPS_VERSION}",  # keep
        "k8s.io/kops.GitVersion": "{BUILD_SCM_REVISION}",  # keep
    },
)

go_test(
    name = "go_default_test",
    size = "small",
    srcs = [
        "create_cluster_integration_test.go",
        "create_cluster_test.go",
        "createcluster_test.go",
        "delete_confirm_test.go",
        "integration_test.go",
        "lifecycle_integration_test.go",
        "toolbox_template_test.go",
    ],
    data = [
        "//channels:channeldata",  # keep
        "//tests/integration/create_cluster:exported_testdata",  # keep
        "//tests/integration/update_cluster:exported_testdata",  # keep
    ],
    embed = [":go_default_library"],
    shard_count = 10,
    deps = [
        "//cloudmock/aws/mockec2:go_default_library",
        "//cmd/kops/util:go_default_library",
        "//pkg/apis/kops:go_default_library",
        "//pkg/diff:go_default_library",
        "//pkg/featureflag:go_default_library",
        "//pkg/jsonutils:go_default_library",
        "//pkg/kopscodecs:go_default_library",
        "//pkg/testutils:go_default_library",
        "//upup/pkg/fi:go_default_library",
        "//upup/pkg/fi/cloudup:go_default_library",
        "//upup/pkg/fi/cloudup/awsup:go_default_library",
        "//upup/pkg/fi/cloudup/gce:go_default_library",
        "//util/pkg/ui:go_default_library",
        "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
        "//vendor/github.com/aws/aws-sdk-go/service/ec2:go_default_library",
        "//vendor/github.com/ghodss/yaml:go_default_library",
        "//vendor/golang.org/x/crypto/ssh:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
        "//vendor/k8s.io/klog:go_default_library",
    ],
)
